<?php

/**
 * Enquiry form.
 *
 * @package    MVM Vehicle Showroom (r)
 * @subpackage form
 * @author     Bo Wang < beau32 [at] gmail.com >
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class VehicleEnquiryForm extends BaseEnquiryForm {
  public function configure() {
    unset($this['created_at'], $this['updated_at']);

    $this->useFields(array('name', 'email','phone','body'));
    
    $this->setValidator('name',new sfValidatorString(array('required' => true)));
    $this->setValidator('email',new sfValidatorEmail(array('required'=>true), array('invalid' => 'Email address is invalid.')));
    $this->setValidator('phone',new sfValidatorString(array('required' => true)));
    $this->setValidator('body', new sfValidatorString(array('min_length' => 4),
    array(
    'required'   => 'The message field is required',
    'min_length' => 'The message "%value%" is too short. It must be of %min_length% characters at least.',
    )));
    $this->widgetSchema['body']->setLabel('Enquiry');
  }
}
